//
//  RecommendDetailController.m
//  kr_36
//
//  Created by lmt on 16/1/26.
//  Copyright © 2016年 www.lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "RecommendDetailController.h"

@interface RecommendDetailController ()<UIWebViewDelegate>

@property (nonatomic, retain) UIWebView *web;

@end

@implementation RecommendDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.web = [[UIWebView alloc] initWithFrame:self.view.bounds];
    
    [_web loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.str]]];
    
    [self.view addSubview:_web];
    
    _web.delegate = self;
    
    NSLog(@"%@", self.str);
    
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
    
    // 改变颜色
//    
//    [_web stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('body')[0].style.background='gray'"];
//    [_web stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('div')[9].style.background='gray'"];
//    [_web stringByEvaluatingJavaScriptFromString:@"document.getElementsByTagName('h1')[0].style.background='gray'"];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
